<div class="fornecedores index">

	<div class="row">
		<div class="col-md-12">
			<div class="page-header">
				<h1><?php echo __('Lista de Fornecedores'); ?></h1>
			</div>
		</div><!-- end col md 12 -->
	</div><!-- end row -->



	<div class="row">

		<div class="col-md-3 col-sm-6 col-xs-12">
			<div class="actions">
				<div class="panel panel-default">
					<div class="panel-heading"><h5>Ações</h5></div>
						<div class="panel-body">
							<ul class="nav nav-pills nav-stacked">
								<li><?php echo $this->Html->link(__('<span class="glyphicon glyphicon-plus"></span>&nbsp;&nbsp;Novo Fornecedor'), array('action' => 'add'), array('escape' => false)); ?></li>
								<li><?php //echo $this->Html->link(__('<span class="glyphicon glyphicon-list"></span>&nbsp;&nbsp;List Enderecos'), array('controller' => 'enderecos', 'action' => 'index'), array('escape' => false)); ?> </li>
								<li><?php //echo $this->Html->link(__('<span class="glyphicon glyphicon-plus"></span>&nbsp;&nbsp;New Endereco'), array('controller' => 'enderecos', 'action' => 'add'), array('escape' => false)); ?> </li>
							</ul>
						</div><!-- end body -->
				</div><!-- end panel -->
			</div><!-- end actions -->
		</div><!-- end col md 3 -->

		<div class="col-md-9">
			<div class="table-responsive panel panel-default">
				<div class="panel-heading">
			<?php echo $this->Search->create('Filtro',array('class' => 'form-inline'));?>
					
						<div class="row">
						<div class="form-group col-md-5 col-sm-5 col-xs-5">
							<?php echo $this->Search->input('filter1', array('class' => 'form-control', 'placeholder' => 'pesquise por fornecedor...'));?>
						</div>
						<div class="form-group col-md-5 col-sm-5 col-xs-5">
							<?php echo $this->Search->input('filter2', array('class' => 'form-control', 'placeholder' => 'pesquise por representante...'));?>
						</div>
						<div class="form-group col-md-2 col-sm-2 col-xs-2">
						
							<?php echo $this->Search->submit(__('Pesquisar'),  array('class' => 'btn btn-default'));
							echo $this->Search->end();?>
						</div>
						</div>
					</div>
				<table cellpadding="0" cellspacing="0" class="table table-bordered">
				<thead>
					<tr>
						<th><?php echo $this->Paginator->sort('id', '#'); ?></th>
						<th><?php echo $this->Paginator->sort('nome', 'Fornecedor'); ?></th>
						<th><?php echo $this->Paginator->sort('cnpj'); ?></th>
						<th><?php echo $this->Paginator->sort('telefone'); ?></th>
						<th><?php echo $this->Paginator->sort('email'); ?></th>
						<th><?php echo $this->Paginator->sort('representante'); ?></th>
						<!--<th><?php //echo $this->Paginator->sort('site'); ?></th>
						<th><?php //echo $this->Paginator->sort('endereco_id'); ?></th>
						 <th><?php //echo $this->Paginator->sort('descricao'); ?></th>-->
						<th class="actions"></th>
					</tr>
				</thead>
				<tbody>
				<?php foreach ($fornecedores as $fornecedore): ?>
					<tr>
						<td><?php echo h($fornecedore['Fornecedore']['id']); ?>&nbsp;</td>
						<td><?php echo h($fornecedore['Fornecedore']['nome']); ?>&nbsp;</td>
						<td><?php echo h($fornecedore['Fornecedore']['cnpj']); ?>&nbsp;</td>
						<td><?php echo h($fornecedore['Fornecedore']['telefone']); ?>&nbsp;</td>
						<td><?php echo h($fornecedore['Fornecedore']['email']); ?>&nbsp;</td>
						<td><?php echo h($fornecedore['Fornecedore']['representante']); ?>&nbsp;</td>
						<!--<td><?php //echo h($fornecedore['Fornecedore']['site']); ?>&nbsp;</td>
						 <td><?php //echo h($fornecedore['Ramo']['descricao']); ?>&nbsp;</td>-->
						<td class="actions" width="100px">
							<?php echo $this->Html->link('<span class="glyphicon glyphicon-search" title="Detalhes do Fornecedor"></span>', array('action' => 'view', $fornecedore['Fornecedore']['id']), array('escape' => false)); ?>
							<?php echo $this->Html->link('<span class="glyphicon glyphicon-edit" title="Editar" style="margin-left:16px;"></span>', array('action' => 'edit', $fornecedore['Fornecedore']['id']), array('escape' => false)); ?>
							<?php echo $this->Form->postLink('<span class="glyphicon glyphicon-remove" title="Excluir Fornecedor" style="margin-left:16px;"></span>', array('action' => 'delete', $fornecedore['Fornecedore']['id']), array('escape' => false), __('Deseja realmente excluir este fornecedor # %s?', $fornecedore['Fornecedore']['id'])); ?>
						</td>
					</tr>
				<?php endforeach; ?>
				</tbody>
			</table>
			</div>
			<p>
				<small><?php echo $this->Paginator->counter(array('format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')));?></small>
			</p>

			<?php
			$params = $this->Paginator->params();
			if ($params['pageCount'] > 1) {
			?>
			<ul class="pagination pagination-sm">
				<?php
					echo $this->Paginator->prev('&larr; Previous', array('class' => 'prev','tag' => 'li','escape' => false), '<a onclick="return false;">&larr; Previous</a>', array('class' => 'prev disabled','tag' => 'li','escape' => false));
					echo $this->Paginator->numbers(array('separator' => '','tag' => 'li','currentClass' => 'active','currentTag' => 'a'));
					echo $this->Paginator->next('Next &rarr;', array('class' => 'next','tag' => 'li','escape' => false), '<a onclick="return false;">Next &rarr;</a>', array('class' => 'next disabled','tag' => 'li','escape' => false));
				?>
			</ul>
			<?php } ?>

		</div> <!-- end col md 9 -->
	</div><!-- end row -->


</div><!-- end containing of content -->